//
//  YMHomeHealthOneCell.m
//  YMMedical
//
//  Created by y s on 2023/7/19.
//

#import "YMHomeHealthOneCell.h"
#import "YMHomeHealthItemCardView.h"


@interface YMHomeHealthOneCell ()

@property (nonatomic, strong) YMHomeHealthItemCardView *vCard;

@end


@implementation YMHomeHealthOneCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setUI];
    }
    return self;
}

#pragma mark - UI methods
- (void)setUI{
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.contentView.backgroundColor = [UIColor clearColor];
    self.backgroundColor = [UIColor clearColor];
    
    [self.contentView addSubview:self.vCard];
    [self.vCard mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo([SFitUtil fit:15]);
        make.right.mas_equalTo([SFitUtil fit:-15]);
        make.bottom.mas_equalTo([SFitUtil fit:-20]);
    }];
    
}


#pragma mark - public methods
+ (CGFloat)getCellHeight{
    return [SFitUtil fit:15+20+102];
}
- (void)setArrItem:(NSArray *)arrItem{
    _arrItem = arrItem;
    if (_arrItem.count > 0){
        self.vCard.dict = [SDataUtil dictOf:_arrItem.firstObject];
    }
}


#pragma mark - Event Action



#pragma mark - setter and getter
- (YMHomeHealthItemCardView *)vCard{
    if (_vCard == nil){
        _vCard = [[YMHomeHealthItemCardView alloc] init];
        _vCard.showSelect = YES;
    }
    return _vCard;
}


@end
